Skip to content

Conversation

@Detoo
Copy link

@Detoo Detoo commented Oct 27, 2025

Added

  • Re-enabled the remaining two MetaVest modes: TokenOption and RestrictedToken
  • Files added back:
    • TokenOptionAllocation.sol
    • TokenOptionFactory.sol
    • RestrictedTokenAllocation.sol
    • RestrictedTokenFactory.sol
  • Added recipient support to TokenOption and RestrictedToken modes
  • Uncommented and fixed all related tests for the above two modes

Updated

  • Fixed contract-too-big errors by migrating most MetaVesTController logic to MetaVesTControllerStorage
    # Contract size by: `forge build --via-ir --optimize --optimizer-runs 200 --sizes`
      ╭----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------╮
      | Contract                                                                         | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) |
      +====================================================================================================================================================================+
      | Address                                                                          | 57               | 85                | 24,519             | 49,067              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | MetaVesTControllerStorage                                                        | 10,554           | 10,586            | 14,022             | 38,566              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | MetaVestDealLib                                                                  | 57               | 85                | 24,519             | 49,067              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | RestrictedTokenAward                                                             | 9,201            | 10,869            | 15,375             | 38,283              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | RestrictedTokenFactory                                                           | 12,366           | 12,392            | 12,210             | 36,760              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | TokenOptionAllocation                                                            | 8,934            | 10,595            | 15,642             | 38,557              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | TokenOptionFactory                                                               | 12,092           | 12,118            | 12,484             | 37,034              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | VestingAllocation                                                                | 7,312            | 8,876             | 17,264             | 40,276              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | VestingAllocationFactory                                                         | 10,342           | 10,368            | 14,234             | 38,784              |
      |----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------|
      | metavestController                                                               | 21,355           | 21,401            | 3,221              | 27,751              |
      ╰----------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------╯
    
  • Storage counterpart of MetaVesTController logic to return "error codes" so the core contract could emit events or revert errors accordingly
  • Fixed stack-too-deep errors with parameter builder MetaVestDealLib.draft()...
  • Distinguished vestingToken vs paymentToken in all tests, especially for TokenOption and RestrictedToken types
  • Misc script changes due to extra two modes
  • Updated README with build and test specs

@Detoo Detoo marked this pull request as ready for review October 27, 2025 23:21
@Detoo Detoo force-pushed the feat/re-enable-options branch from 19842db to c2531a9 Compare December 11, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants